<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="pub/top_list2.jsp"%> 
<% 
String userid = (String) request.getSession().getAttribute("name");
String goodsxid=(String)request.getParameter("goodsxid");
String id=(String)request.getParameter("id");
String[] params = new String[1];
params[0] =goodsxid;
String sql = "select a.sximg,b.oprice,a.sxname,c.classify,e.* from goodsx a, goodjiage b,shuxing c,goodinfo e where a.goodsxid=b.goodsxid and e.productid=a.productid and a.sxid=c.sxid and a.goodsxid=?";
Map<String, Object> map= db.queryMap(sql, params);

MyDB db2 = My.getDb1();
String[] param = new String[1];
param[0] =userid;
String sql2="select * from manageadd where userid=? and state=1";
Map<String, Object> mp= db2.queryMap(sql2, param);
//System.out.println(mp);
 %>

<body>
	<header class="top-header fixed-header">
			<a class="icona" href="javascript:history.go(-1)">
					<img src="images/left.png"/>
			</a>
			<h3>去结算</h3>
			<!-- <a class="iconb" href="shopcar.html">
			</a> -->
	</header>
	
	<div class="contaniner fixed-cont">
		<section class="to-buy">
			<header>
				<div class="now">
					<span><img src="images/map-icon.png"/></span>
						<dl>
							<dt>
								<b><%=mp.get("username") %></b>
								<strong><%=userid %></strong>
							</dt>
							<dd><%=mp.get("province") %><%=mp.get("city") %><%=mp.get("distric") %><%=mp.get("address") %></dd>
							<p>其他地址</p>
						</dl> 
				</div>
				
				<div class="to-now">
					<div class="tonow">
						<!-- 	<label for="tonow"  onselectstart="return false" ></label>
							<input type="checkbox" id="tonow"/> -->
					</div>
					<dl>
							<dt>
								<b><%=mp.get("username") %></b>
								<strong><%=userid %></strong>
							</dt>
							<dd><%=mp.get("province") %><%=mp.get("city") %><%=mp.get("distric") %><%=mp.get("address") %></dd>
					</dl>
					<h3><a href="go-address.jsp"><img src="images/write.png"/></a></h3>
				</div>
			</header>
			 
			<div class="buy-list">
				<ul>
					<a href="detail.html">
						<figure>
							<img src="<%=map.get("sximg") %>"/>
						</figure>
						<li>
							<h3>超级大品牌服装，现在够买只要998</h3>
							<span>
								<%=map.get("classify") %>：<%=map.get("sxname") %>
								<br />
							</span>
							<b>￥<%=map.get("oprice") %></b>
							<small>×1</small>
						</li>
					</a>
				</ul>
				<dl>
					<dd>
						<span>商品总额</span>
						<small>￥<%=map.get("oprice") %></small>
					</dd>
					<dt>
						<textarea rows="4" id="liuyan" value="" placeholder="给卖家留言（50字以内）"></textarea>
					</dt>
				</dl>
			</div>
		</section>
		<!--底部不够-->
		<div style="margin-bottom: 9%;"></div>
	</div>
	
	<footer class="buy-footer fixed-footer">
			<p> 
				<small>运费</small>
				<b>暂无&nbsp;&nbsp;</b>
				<small>总金额</small>
				<b><%=map.get("oprice") %></b>
			</p>
			
				
				<input type="button" onclick="fukuan()" value="去付款"/>
	</footer>
	<script type="text/javascript">
	function fukuan(){
		var liuyan=document.getElementById("liuyan").value;
		var allprice='<%=map.get("oprice") %>';
		var id='<%=id%>';
		var dz='<%=mp.get("id")%>'
		window.location.href="fukun.jsp?liuyan="+liuyan+"&allprice="+allprice+"&id="+id+"&dz="+dz;
	}                         
	</script>
	
	<script type="text/javascript">
		$(".to-now .tonow label").on('touchstart',function(){
			if($(this).hasClass('ton')){
				$(".to-now .tonow label").removeClass("ton")
			}else{
				$(".to-now .tonow label").addClass("ton")
			}
		})
	</script>

</body>
</html>